function profit_percentage() {
	$.ajax({
		url: '/spider-factory/stock/profit_percentage',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "7"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			if(list.length>0){
				let tr1='<tr><td style="text-align:left;"><b>营业收入(元)</b></td>'
				let tr2='<tr><td style="text-align:left;"><b>营业成本(元)</b></td>'
				let tr3='<tr><td style="text-align:left;">&nbsp;&nbsp;营业税金及附加(元)</td>'
				let tr4='<tr><td style="text-align:left;">&nbsp;&nbsp;期间费用(元)</td>'
				let tr5='<tr><td style="text-align:left;">&nbsp;&nbsp;销售费用(元)</td>'
				let tr6='<tr><td style="text-align:left;">&nbsp;&nbsp;管理费用(元)</td>'
				let tr7='<tr><td style="text-align:left;">&nbsp;&nbsp;财务费用(元)</td>'
				let tr8='<tr><td style="text-align:left;">&nbsp;&nbsp;资产减值损失(元)</td>'
				let tr9='<tr><td style="text-align:left;"><b>其他经营收益(元)</b></td>'
				let tr10='<tr><td style="text-align:left;">&nbsp;&nbsp;营业税金及附加(元)</td>'
				let tr11='<tr><td style="text-align:left;">&nbsp;&nbsp;公允价值变动损益(元)</td>'
				let tr12='<tr><td style="text-align:left;"><b>营业利润(元)</b></td>'
				let tr13='<tr><td style="text-align:left;">&nbsp;&nbsp;加：营业外收入(元)</td>'
				let tr14='<tr><td style="text-align:left;">&nbsp;&nbsp;补贴收入(元)</td>'
				let tr15='<tr><td style="text-align:left;">&nbsp;&nbsp;减：营业外收入(元)</td>'
				let tr16='<tr><td style="text-align:left;"><b>利润总额(元)</b></td>'
				let tr17='<tr><td style="text-align:left;">&nbsp;&nbsp;减：所得税(元)</td>'
				let tr18='<tr><td style="text-align:left;"><b>净利润(元)</b></td>'
				for(const i in list){
						tr1+='<td>'+list[i].yingyeshouru+'</td><td>100%</td>'
						tr2+='<td>'+list[i].yingyechengben+'</td><td>'+list[i].yingyechengben_ZB+'</td>'
						tr3+='<td>'+list[i].yingyeshuijinAndFJ+'</td><td>'+list[i].yingyeshuijinAndFJ_ZB+'</td>'
						tr4+='<td>'+list[i].qijianfeiyong+'</td><td>'+list[i].qijianfeiyong_ZB+'</td>'
						tr5+='<td>'+list[i].xiaoshoufeiyong+'</td><td>'+list[i].xiaoshoufeiyong_ZB+'</td>'
						tr6+='<td>'+list[i].guanlifeiyong+'</td><td>'+list[i].guanlifeiyong_ZB+'</td>'
						tr7+='<td>'+list[i].caiwufeiyong+'</td><td>'+list[i].caiwufeiyong_ZB+'</td>'
						tr8+='<td>'+list[i].zichangJZSS+'</td><td>'+list[i].zichangJZSS_ZB+'</td>'
						tr9+='<td>'+list[i].qitajingyingSY+'</td><td>'+list[i].qitajingyingSY_ZB+'</td>'
						tr10+='<td>'+list[i].yingyeshuijinAndFJ_qita+'</td><td>'+list[i].yingyeshuijinAndFJ_qita_ZB+'</td>'
						tr11+='<td>'+list[i].gongyunjiazhiBDSY+'</td><td>'+list[i].gongyunjiazhiBDSY_ZB+'</td>'
						tr12+='<td>'+list[i].yingyelirun+'</td><td>'+list[i].yingyelirun_ZB+'</td>'
						tr13+='<td>'+list[i].jia_yingyewaiSR+'</td><td>'+list[i].jia_yingyewaiSR_ZB+'</td>'
						tr14+='<td>'+list[i].butieshouru+'</td><td>'+list[i].butieshouru_ZB+'</td>'
						tr15+='<td>'+list[i].jian_yingyewaiSR+'</td><td>'+list[i].jian_yingyewaiSR_ZB+'</td>'
						tr16+='<td>'+list[i].lirunzonge+'</td><td>'+list[i].lirunzonge_ZB+'</td>'
						tr17+='<td>'+list[i].jian_suodeshui+'</td><td>'+list[i].jian_suodeshui_ZB+'</td>'
						tr18+='<td>'+list[i].jinglirun+'</td><td>'+list[i].jinglirun_ZB+'</td>'
				}
				if(list.length<7){
					let l=list.length
					while(l<7){
						tr1+='<td>-</td><td>-</td>'
						tr2+='<td>-</td><td>-</td>'
						tr3+='<td>-</td><td>-</td>'
						tr4+='<td>-</td><td>-</td>'
						tr5+='<td>-</td><td>-</td>'
						tr6+='<td>-</td><td>-</td>'
						tr7+='<td>-</td><td>-</td>'
						tr8+='<td>-</td><td>-</td>'
						tr9+='<td>-</td><td>-</td>'
						tr10+='<td>-</td><td>-</td>'
						tr11+='<td>-</td><td>-</td>'
						tr12+='<td>-</td><td>-</td>'
						tr13+='<td>-</td><td>-</td>'
						tr14+='<td>-</td><td>-</td>'
						tr15+='<td>-</td><td>-</td>'
						tr16+='<td>-</td><td>-</td>'
						tr17+='<td>-</td><td>-</td>'
						tr18+='<td>-</td><td>-</td>'
						l+=1
					}
				}
				tr1+='</tr>'
				tr2+='</tr>'
				tr3+='</tr>'
				tr4+='</tr>'
				tr5+='</tr>'
				tr6+='</tr>'
				tr7+='</tr>'
				tr8+='</tr>'
				tr9+='</tr>'
				tr10+='</tr>'
				tr11+='</tr>'
				tr12+='</tr>'
				tr13+='</tr>'
				tr14+='</tr>'
				tr15+='</tr>'
				tr16+='</tr>'
				tr17+='</tr>'
				tr18+='</tr>'
				$('#profit_percentage').append(
					tr1+tr2+tr3+tr4+tr5+tr6+tr7+tr8+tr9+tr10+tr11+
					tr12+tr13+tr14+tr15+tr16+tr17+tr18
				)
			}else{
				$('#profit_percentage_show').hide()
				$('#profit_percentage_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}

function guarantee() {
	$.ajax({
		url: '/spider-factory/stock/guarantee',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "10"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			let num=1
			if(list.length>0){
				for(const i in list){
					$('#guarantee').append(
						'<tr>'+
							'<td>'+num+'</td>'+
							'<td>'+(list[i].publicationDate=="" ? "" : list[i].publicationDate.substring(0,10))+'</td>'+
							'<td>'+list[i].stockGuarantee+'</td>'+
							'<td>'+list[i].stockBeGuarantee+'</td>'+
							'<td>'+list[i].stockGuaranteeMode+'</td>'+
							'<td>'+list[i].stockGuaranteeAmount+'</td>'+
							'<td><a href="/spider-factory/stock/guarantee-detail?article_public_id='+list[i].article_public_id+'&companyName='+stock+'" target="_blank">详情</a></td>'+
						'</tr>'
					)
					num+=1
				}
				if(resObj.totalPage>1){
					$('#guarantee').append(
						'<tr>'+
							'<td colspan="7" style="text-align:center;"><a href="/spider-factory/stock/guarantee-more?firm_id='+firm_id+'&companyName='+stock+'" target="_blank">查看更多</a></td>'+
						'</tr>'
					)
				}
			}else{
				$('#guarantee_show').hide()
				$('#guarantee_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}

function finance_index() {
	$.ajax({
		url: '/spider-factory/stock/finance_index',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "10"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			if(list.length>0){
				let tr1='<tr><td>基本每股收益(元)</td>'
				let tr2='<tr><td>扣费每股收益(元)</td>'
				let tr3='<tr><td>稀释每股收益(元)</td>'
				let tr4='<tr><td>每股净资产(元)</td>'
				let tr5='<tr><td>每股公积金(元)</td>'
				let tr6='<tr><td>每股未分配利润(元)</td>'
				let tr7='<tr><td>每股经营现金流(元)</td>'
				let tr8='<tr><td>营业总收入(元)</td>'
				let tr9='<tr><td>毛利润(元)</td>'
				let tr10='<tr><td>归属净利润(元)</td>'
				let tr11='<tr><td>扣费净利润(元)</td>'
				let tr12='<tr><td>营业总收入同比增长(%)</td>'
				let tr13='<tr><td>归属净利润同比增长(%)</td>'
				let tr14='<tr><td>扣费净利润同比增长(%)</td>'
				let tr15='<tr><td>营业总收入滚动环比增长(%)</td>'
				let tr16='<tr><td>归属净利润滚动环比增长(%)</td>'
				let tr17='<tr><td>扣费净利润滚动环比增长(%)</td>'
				let tr18='<tr><td>加权净资产收益率(%)</td>'
				let tr19='<tr><td>摊薄净资产收益率(%)</td>'
				let tr20='<tr><td>摊薄总资产收益率(%)</td>'
				let tr21='<tr><td>毛利率(%)</td>'
				let tr22='<tr><td>净利率(%)</td>'
				let tr23='<tr><td>实际税率(%)</td>'
				let tr24='<tr><td>预收款/营业收入</td>'
				let tr25='<tr><td>销售现金流/营业收入</td>'
				let tr26='<tr><td>经营现金流/营业收入</td>'
				let tr27='<tr><td>总资产周转率(次)</td>'
				let tr28='<tr><td>应收帐款周转天数(次)</td>'
				let tr29='<tr><td>存货周转天数(天)</td>'
				let tr30='<tr><td>资产负债率(%)</td>'
				let tr31='<tr><td>流动负债/总资产(%)</td>'
				let tr32='<tr><td>流动比率</td>'
				let tr33='<tr><td>速动比率</td>'
				for(const i in list){
						tr1+='<td>'+list[i].jibenmeigushouyi+'</td>'
						tr2+='<td>'+list[i].koufeimeigushouyi+'</td>'
						tr3+='<td>'+list[i].xishimeigushouyi+'</td>'
						tr4+='<td>'+list[i].meigujingzichan+'</td>'
						tr5+='<td>'+list[i].meigugongjijin+'</td>'
						tr6+='<td>'+list[i].meiguweifenpeilirun+'</td>'
						tr7+='<td>'+list[i].meigujingyingxianjinliu+'</td>'
						tr8+='<td>'+list[i].yingyezongshouru+'</td>'
						tr9+='<td>'+list[i].maolirun+'</td>'
						tr10+='<td>'+list[i].guishujinglirun+'</td>'
						tr11+='<td>'+list[i].koufeijinglirun+'</td>'
						tr12+='<td>'+list[i].yingyezongshourutongbizengzhang+'</td>'
						tr13+='<td>'+list[i].guishujingliruntongbizengzhang+'</td>'
						tr14+='<td>'+list[i].koufeijingliruntongbizengzhang+'</td>'
						tr15+='<td>'+list[i].yingyezongshourugundongzengzhang+'</td>'
						tr16+='<td>'+list[i].guishujinglirungundongzengzhang+'</td>'
						tr17+='<td>'+list[i].koufeijinglirungundongzengzhang+'</td>'
						tr18+='<td>'+list[i].jiaqunjingzichanshouyilv+'</td>'
						tr19+='<td>'+list[i].tanbaojingzichanshouyilv+'</td>'
						tr20+='<td>'+list[i].tanbaozongzichanshouyilv+'</td>'
						tr21+='<td>'+list[i].maolilv+'</td>'
						tr22+='<td>'+list[i].jinglilv+'</td>'
						tr23+='<td>'+list[i].shijishuilv+'</td>'
						tr24+='<td>'+list[i].yushoukuan+'</td>'
						tr25+='<td>'+list[i].xiaoshouxianjinliu+'</td>'
						tr26+='<td>'+list[i].jingyingxianjinliu+'</td>'
						tr27+='<td>'+list[i].zongzichanzhouzhuanlv+'</td>'
						tr28+='<td>'+list[i].yingshouzhangkuanzhouzhuantianshu+'</td>'
						tr29+='<td>'+list[i].cunhuozhouzhuantianshu+'</td>'
						tr30+='<td>'+list[i].zichanfuzhailv+'</td>'
						tr31+='<td>'+list[i].liudongfuzhai+'</td>'
						tr32+='<td>'+list[i].liudongbilv+'</td>'
						tr33+='<td>'+list[i].sudubiilv+'</td>'
				}
				if(list.length<10){
					let l=list.length
					while(l<10){
						tr1+='<td>-</td>'
						tr2+='<td>-</td>'
						tr3+='<td>-</td>'
						tr4+='<td>-</td>'
						tr5+='<td>-</td>'
						tr6+='<td>-</td>'
						tr7+='<td>-</td>'
						tr8+='<td>-</td>'
						tr9+='<td>-</td>'
						tr10+='<td>-</td>'
						tr11+='<td>-</td>'
						tr12+='<td>-</td>'
						tr13+='<td>-</td>'
						tr14+='<td>-</td>'
						tr15+='<td>-</td>'
						tr16+='<td>-</td>'
						tr17+='<td>-</td>'
						tr18+='<td>-</td>'
						tr19+='<td>-</td>'
						tr20+='<td>-</td>'
						tr21+='<td>-</td>'
						tr22+='<td>-</td>'
						tr23+='<td>-</td>'
						tr24+='<td>-</td>'
						tr25+='<td>-</td>'
						tr26+='<td>-</td>'
						tr27+='<td>-</td>'
						tr28+='<td>-</td>'
						tr29+='<td>-</td>'
						tr30+='<td>-</td>'
						tr31+='<td>-</td>'
						tr32+='<td>-</td>'
						tr33+='<td>-</td>'
						l+=1
					}
				}
				tr1+='</tr>'
				tr2+='</tr>'
				tr3+='</tr>'
				tr4+='</tr>'
				tr5+='</tr>'
				tr6+='</tr>'
				tr7+='</tr>'
				tr8+='</tr>'
				tr9+='</tr>'
				tr10+='</tr>'
				tr11+='</tr>'
				tr12+='</tr>'
				tr13+='</tr>'
				tr14+='</tr>'
				tr15+='</tr>'
				tr16+='</tr>'
				tr17+='</tr>'
				tr18+='</tr>'
				tr19+='</tr>'
				tr20+='</tr>'
				tr21+='</tr>'
				tr22+='</tr>'
				tr23+='</tr>'
				tr24+='</tr>'
				tr25+='</tr>'
				tr26+='</tr>'
				tr27+='</tr>'
				tr28+='</tr>'
				tr29+='</tr>'
				tr30+='</tr>'
				tr31+='</tr>'
				tr32+='</tr>'
				tr33+='</tr>'
				$('#finance_index').append(
					tr1+tr2+tr3+tr4+tr5+tr6+tr7+tr8+tr9+tr10+tr11+
					tr12+tr13+tr14+tr15+tr16+tr17+tr18+tr19+tr20+
					tr21+tr22+tr23+tr24+tr25+tr26+tr27+tr28+tr29+
					tr30+tr31+tr32+tr33
				)
			}else{
				$('#finance_index_show').hide()
				$('#finance_index_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}

function dividend_info() {
	$.ajax({
		url: '/spider-factory/stock/dividend_info',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "10"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			let num=1
			if(list.length>0){
				for(const i in list){
					$('#dividend_info').append(
						'<tr>'+
							'<td>'+num+'</td>'+
							'<td>'+(list[i].publicationDate==undefined ? "" : list[i].publicationDate.substring(0,10))+'</td>'+
							'<td>'+(list[i].bonusScheme==undefined ? "" : list[i].bonusScheme)+'</td>'+
							'<td>'+(list[i].equityRegDate==undefined ? "" : list[i].equityRegDate.substring(0,10))+'</td>'+
							'<td>'+(list[i].xrXdDate==undefined ? "" : list[i].xrXdDate.substring(0,10))+'</td>'+
							'<td>'+(list[i].declarationDate==undefined ? "" : list[i].declarationDate.substring(0,10))+'</td>'+
							'<td>'+(list[i].programmeProgress==undefined ? "" : list[i].programmeProgress)+'</td>'+
						'</tr>'
					)
					num+=1
				}
				if(resObj.totalPage>1){
					$('#dividend_info').append(
						'<tr>'+
							'<td colspan="7" style="text-align:center;"><a href="/spider-factory/stock/dividend_info-more?firm_id='+firm_id+'&companyName='+stock+'" target="_blank">查看更多</a></td>'+
						'</tr>'
					)
				}
			}else{
				$('#dividend_info_show').hide()
				$('#dividend_info_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}